<template>
    <div>

        <a-input placeholder="用户名" v-model="username"/>
        <a-input placeholder="密码" v-model="password"/>
        <!-- 钉钉登录 -->
        <a-button @click="ding"><img src="../../../static/dingding.png"></a-button>
        <!-- 码云登录 -->
        <a-button @click="gitee"><img src="http://localhost:8000/static/mayun.png"></a-button>


    </div>
</template>

<script>
export default {
    data() {
        return {
            username:'',
            password:''
        }
    },

    mounted:function(){
        // 接收后端返回到url的参数（uid,username）
        var user = this.$route.query.username
        var uid = this.$route.query.uid
        if (user){
          localStorage.setItem('username',user)
          localStorage.setItem('uid',uid)
          this.$router.push({path:'/myhome'})
          this.$toast('登录成功')
        }
    },

    methods:{
        ding(){
            // this.axios.get("http://localhost:8000/dinglogin/").then(res=>{
            //     console.log('跳转成功。。。')
            // })
            window.open("http://localhost:8000/dinglogin/")
        },
        gitee(){
            window.location.href = "http://localhost:8000/gitee/";
        }
    }
}
</script>

<style>

</style>